std::trunc

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

float       trunc( float arg );
(C++0x feature)
double      trunc( double arg );
(C++0x feature)
long double trunc( long double arg );
(C++0x feature)

Computes nearest integer not greater in magnitude than arg.

Contents

Parameters

arg - floating point value

Return value

nearest integer not greater in magnitude than arg.

Notes

The integer value can be always represented by the given floating point type.

See also

floor
nearest integer not greater than the given value
(function)
ceil
nearest integer not less than the given value
(function)
round
lround
llround
(C++0x)
(C++0x)
(C++0x)
nearest integer, rounding away from zero in halfway cases
(function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages